package UserView;

import Dao.StudentDao;


import Service.ServiceImpl.MoneyserviceImpl;

import java.util.Scanner;

public class Userui {
    static StudentDao studentDao;
    public void UI() throws Exception {
        MoneyserviceImpl moneyservice = new MoneyserviceImpl();
        boolean flag = true;
        while (flag) {
            int num = 0;
            while (true) {
                try {
                    System.out.println("----------------零钱通菜单--------------");
                    System.out.println("1.零钱明细");
                    System.out.println("2.收益入账");
                    System.out.println("3.消费");
                    System.out.println("4.退   出");
                    System.out.println("0.退出系统");
                    System.out.println("亲，输入你所需要的业务序号");
                    Scanner scanner = new Scanner(System.in);
                    num = scanner.nextInt();
                    break;
                } catch (Exception e) {
                    System.out.println("请输入正确的业务数字");
                }
            }
            switch (num) {
                case 1:
                       moneyservice.showMon();
                    break;
                case 2:
                    moneyservice.addMon( );
                    break;
                case 3:moneyservice.updateMon();
                    break;
                default:
                    System.out.println("退出系统");
                    flag = false;
                    break;
            }
        }
    }
}